From: umherirrender Date: Sat, 19 Jul 2014 21:12:10 +0000 (+0200) Subject: Fixed spacing X-Git-Tag: 1.31.0-rc.0~14872^2 X-Git-Url: http://git.cyclocoop.org/%7D%7Cconcat%7B?a=commitdiff_plain;h=2b021dc48a423dd43f7c60046315cfe2113a3fb6;p=lhc%2Fweb%2Fwiklou.git Fixed spacing - Added/removed spaces around parenthesis - Added space after switch/if/foreach - changed else if to elseif Change-Id: I99cda543e0e077320091addd75c188cb6e3a42c2 --- diff --git a/includes/Html.php b/includes/Html.php index 5f4655c28a..dbabbae031 100644 --- a/includes/Html.php +++ b/includes/Html.php @@ -502,7 +502,7 @@ class Html { // Remove duplicates and create the string $value = implode( ' ', array_unique( $value ) ); - } else if ( is_array( $value ) ) { + } elseif ( is_array( $value ) ) { throw new MWException( "HTML attribute $key can not contain a list of values" ); } diff --git a/includes/Import.php b/includes/Import.php index 177d0230fb..6aab157520 100644 --- a/includes/Import.php +++ b/includes/Import.php @@ -45,7 +45,7 @@ class WikiImporter { function __construct( ImportStreamSource $source ) { $this->reader = new XMLReader(); - if ( !in_array( 'uploadsource', stream_get_wrappers() ) ) { + if ( !in_array( 'uploadsource', stream_get_wrappers() ) ) { stream_wrapper_register( 'uploadsource', 'UploadSourceAdapter' ); } $id = UploadSourceAdapter::registerSource( $source ); diff --git a/includes/Title.php b/includes/Title.php index 746ffabad6..b66e3e407c 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -979,7 +979,7 @@ class Title { try { $formatter = self::getTitleFormatter(); return $formatter->getNamespaceName( $this->mNamespace, $this->mDbkeyform ); - } catch ( InvalidArgumentException $ex ) { + } catch ( InvalidArgumentException $ex ) { wfDebug( __METHOD__ . ': ' . $ex->getMessage() . "\n" ); return false; } diff --git a/includes/api/ApiQuerySiteinfo.php b/includes/api/ApiQuerySiteinfo.php index 089ce04815..ab737d1dc7 100644 --- a/includes/api/ApiQuerySiteinfo.php +++ b/includes/api/ApiQuerySiteinfo.php @@ -242,7 +242,7 @@ class ApiQuerySiteinfo extends ApiQueryBase { $data['articlepath'] = $config->get( 'ArticlePath' ); $data['scriptpath'] = $config->get( 'ScriptPath' ); $data['script'] = $config->get( 'Script' ); - $data['variantarticlepath'] = $config->get( 'VariantArticlePath' ); + $data['variantarticlepath'] = $config->get( 'VariantArticlePath' ); $data['server'] = $config->get( 'Server' ); $data['servername'] = $config->get( 'ServerName' ); $data['wikiid'] = wfWikiID(); @@ -420,7 +420,7 @@ class ApiQuerySiteinfo extends ApiQueryBase { } $val['url'] = wfExpandUrl( $row['iw_url'], PROTO_CURRENT ); - if (substr( $row['iw_url'], 0, 2) == '//') { + if ( substr( $row['iw_url'], 0, 2 ) == '//' ) { $val['protorel'] = ''; } if ( isset( $row['iw_wikiid'] ) ) { diff --git a/includes/api/ApiResult.php b/includes/api/ApiResult.php index ac64cf01e1..97b74e5640 100644 --- a/includes/api/ApiResult.php +++ b/includes/api/ApiResult.php @@ -597,7 +597,7 @@ class ApiResult extends ApiBase { $this->getMain()->getRequest()->getValues(), array_flip( $this->generatorParams ) ); - } else if ( $this->generatorContinuationData ) { + } elseif ( $this->generatorContinuationData ) { // All the generator-using modules are complete, but the // generator isn't. Continue the generator and restart the // generator-using modules diff --git a/includes/db/DatabasePostgres.php b/includes/db/DatabasePostgres.php index fe5fa1f4e7..49dcbc016d 100644 --- a/includes/db/DatabasePostgres.php +++ b/includes/db/DatabasePostgres.php @@ -827,7 +827,7 @@ __INDEXATTR__; * In Postgres when using FOR UPDATE, only the main table and tables that are inner joined * can be locked. That means tables in an outer join cannot be FOR UPDATE locked. Trying to do * so causes a DB error. This wrapper checks which tables can be locked and adjusts it accordingly. - * + * * MySQL uses "ORDER BY NULL" as an optimization hint, but that syntax is illegal in PostgreSQL. */ function selectSQLText( $table, $vars, $conds = '', $fname = __METHOD__, diff --git a/includes/db/DatabaseSqlite.php b/includes/db/DatabaseSqlite.php index 3e063c6741..af687b249e 100644 --- a/includes/db/DatabaseSqlite.php +++ b/includes/db/DatabaseSqlite.php @@ -342,9 +342,9 @@ class DatabaseSqlite extends DatabaseBase { */ function numFields( $res ) { $r = $res instanceof ResultWrapper ? $res->result : $res; - if ( is_array($r) && count( $r ) > 0 ){ + if ( is_array( $r ) && count( $r ) > 0 ) { // The size of the result array is twice the number of fields. (Bug: 65578) - return count( $r[0] ) / 2 ; + return count( $r[0] ) / 2; } else { // If the result is empty return 0 return 0; diff --git a/includes/htmlform/HTMLSelectField.php b/includes/htmlform/HTMLSelectField.php index 2bf9f8b82f..a198037a06 100644 --- a/includes/htmlform/HTMLSelectField.php +++ b/includes/htmlform/HTMLSelectField.php @@ -29,7 +29,7 @@ class HTMLSelectField extends HTMLFormField { $allowedParams = array( 'tabindex', 'size' ); $customParams = $this->getAttributes( $allowedParams ); - foreach( $customParams as $name => $value ) { + foreach ( $customParams as $name => $value ) { $select->setAttribute( $name, $value ); } diff --git a/includes/installer/MysqlInstaller.php b/includes/installer/MysqlInstaller.php index 10f66925fa..b82e611414 100644 --- a/includes/installer/MysqlInstaller.php +++ b/includes/installer/MysqlInstaller.php @@ -120,7 +120,7 @@ class MysqlInstaller extends DatabaseInstaller { if ( !strlen( $newValues['_InstallUser'] ) ) { $status->fatal( 'config-db-username-empty' ); } - if (!strlen( $newValues['_InstallPassword'] ) ) { + if ( !strlen( $newValues['_InstallPassword'] ) ) { $status->fatal( 'config-db-password-empty', $newValues['_InstallUser'] ); } if ( !$status->isOK() ) { diff --git a/includes/installer/PostgresInstaller.php b/includes/installer/PostgresInstaller.php index 89a697897a..4caf90289c 100644 --- a/includes/installer/PostgresInstaller.php +++ b/includes/installer/PostgresInstaller.php @@ -84,7 +84,7 @@ class PostgresInstaller extends DatabaseInstaller { function submitConnectForm() { // Get variables from the request $newValues = $this->setVarsFromRequest( array( - 'wgDBserver', 'wgDBport','wgDBname', 'wgDBmwschema', + 'wgDBserver', 'wgDBport', 'wgDBname', 'wgDBmwschema', '_InstallUser', '_InstallPassword' ) ); diff --git a/includes/installer/PostgresUpdater.php b/includes/installer/PostgresUpdater.php index 8404c2d68f..390b74f3d4 100644 --- a/includes/installer/PostgresUpdater.php +++ b/includes/installer/PostgresUpdater.php @@ -694,7 +694,7 @@ END; $this->output( "...column '$table.$field' is already of type '$newtype'\n" ); } else { $this->output( "Purging data from cache table '$table'\n" ); - $this->db->query("DELETE from $table" ); + $this->db->query( "DELETE from $table" ); $this->output( "Changing column type of '$table.$field' from '{$fi->type()}' to '$newtype'\n" ); $sql = "ALTER TABLE $table ALTER $field TYPE $newtype"; if ( strlen( $default ) ) { diff --git a/includes/media/XCF.php b/includes/media/XCF.php index b303a0130f..9e6913763a 100644 --- a/includes/media/XCF.php +++ b/includes/media/XCF.php @@ -165,7 +165,7 @@ class XCFHandler extends BitmapHandler { // Try to be consistent with the names used by PNG files. // Unclear from base media type if it has an alpha layer, // so just assume that it does since it "potentially" could. - switch( $header['base_type'] ) { + switch ( $header['base_type'] ) { case 0: $metadata['colorType'] = 'truecolour-alpha'; break; diff --git a/includes/objectcache/BagOStuff.php b/includes/objectcache/BagOStuff.php index dca5f32cbe..de3efd14fa 100644 --- a/includes/objectcache/BagOStuff.php +++ b/includes/objectcache/BagOStuff.php @@ -46,10 +46,10 @@ abstract class BagOStuff { protected $lastError = self::ERR_NONE; /** Possible values for getLastError() */ - const ERR_NONE = 0; // no error + const ERR_NONE = 0; // no error const ERR_NO_RESPONSE = 1; // no response const ERR_UNREACHABLE = 2; // can't connect - const ERR_UNEXPECTED = 3; // response gave some error + const ERR_UNEXPECTED = 3; // response gave some error /** * @param bool $bool diff --git a/includes/page/ImagePage.php b/includes/page/ImagePage.php index 89ca241662..9aff6ef27c 100644 --- a/includes/page/ImagePage.php +++ b/includes/page/ImagePage.php @@ -363,7 +363,7 @@ class ImagePage extends Article { // it can be denoted as the current size being shown. // Vectorized images are "infinitely" big, so all thumb // sizes are shown. - if ( ( ($size[0] <= $width_orig && $size[1] <= $height_orig) + if ( ( ( $size[0] <= $width_orig && $size[1] <= $height_orig ) || $this->displayImg->isVectorized() ) && $size[0] != $width && $size[1] != $height ) { diff --git a/includes/poolcounter/PoolCounterRedis.php b/includes/poolcounter/PoolCounterRedis.php index 2b37b0b747..d609f61427 100644 --- a/includes/poolcounter/PoolCounterRedis.php +++ b/includes/poolcounter/PoolCounterRedis.php @@ -90,7 +90,7 @@ class PoolCounterRedis extends PoolCounter { $this->keySha1 = sha1( $this->key ); $met = ini_get( 'max_execution_time' ); // usually 0 in CLI mode - $this->lockTTL = $met ? 2*$met : 3600; + $this->lockTTL = $met ? 2 * $met : 3600; if ( self::$active === null ) { self::$active = array(); diff --git a/includes/profiler/Profiler.php b/includes/profiler/Profiler.php index 75f6966872..779f8b628b 100644 --- a/includes/profiler/Profiler.php +++ b/includes/profiler/Profiler.php @@ -126,7 +126,7 @@ abstract class Profiler { if ( is_array( $wgProfiler ) ) { if ( !isset( $wgProfiler['class'] ) ) { $class = 'ProfilerStub'; - } elseif ( $wgProfiler['class'] === 'Profiler' ) { + } elseif ( $wgProfiler['class'] === 'Profiler' ) { $class = 'ProfilerStub'; // b/c; don't explode } else { $class = $wgProfiler['class']; diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index fefd3b593a..251ac51e7f 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -206,7 +206,7 @@ class SpecialContributions extends IncludableSpecialPage { $output = $pager->getBody(); if ( !$this->including() ) { $output = '

' . $pager->getNavigationBar() . '

' . - $output. + $output . '

' . $pager->getNavigationBar() . '

'; } $out->addHTML( $output ); diff --git a/includes/specials/SpecialEditWatchlist.php b/includes/specials/SpecialEditWatchlist.php index 369f11f73a..355726ad58 100644 --- a/includes/specials/SpecialEditWatchlist.php +++ b/includes/specials/SpecialEditWatchlist.php @@ -244,7 +244,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage { $talk = $this->msg( 'talkpagelinktext' )->escaped(); // Do a batch existence check $batch = new LinkBatch(); - if (count($titles) >= 100) { + if ( count( $titles ) >= 100 ) { $output = wfMessage( 'watchlistedit-too-many' )->parse(); return; } diff --git a/includes/specials/SpecialPageLanguage.php b/includes/specials/SpecialPageLanguage.php index a432f104db..24eca079a7 100644 --- a/includes/specials/SpecialPageLanguage.php +++ b/includes/specials/SpecialPageLanguage.php @@ -107,7 +107,7 @@ class SpecialPageLanguage extends FormSpecialPage { // Returns the default since the page is not loaded from DB $defLang = $title->getPageLanguage()->getCode(); - $pageId = $title->getArticleID(); + $pageId = $title->getArticleID(); // Check if article exists if ( !$pageId ) { diff --git a/includes/specials/SpecialTrackingCategories.php b/includes/specials/SpecialTrackingCategories.php index bea65ba104..73bdbd6ac6 100644 --- a/includes/specials/SpecialTrackingCategories.php +++ b/includes/specials/SpecialTrackingCategories.php @@ -59,7 +59,7 @@ class SpecialTrackingCategories extends SpecialPage { " ); - foreach( $wgTrackingCategories as $catMsg ) { + foreach ( $wgTrackingCategories as $catMsg ) { /* * Check if the tracking category varies by namespace * Otherwise only pages in the current namespace will be displayed diff --git a/includes/utils/MWCryptHKDF.php b/includes/utils/MWCryptHKDF.php index 6b6655e2fd..aa86ea4589 100644 --- a/includes/utils/MWCryptHKDF.php +++ b/includes/utils/MWCryptHKDF.php @@ -293,7 +293,7 @@ class MWCryptHKDF { for ( $counter = 1; $counter <= $rounds; ++$counter ) { $lastK = hash_hmac( $hash, - $lastK . $info . chr($counter), + $lastK . $info . chr( $counter ), $prk, true ); diff --git a/languages/messages/MessagesCs.php b/languages/messages/MessagesCs.php index 2718a488c3..b796acad02 100644 --- a/languages/messages/MessagesCs.php +++ b/languages/messages/MessagesCs.php @@ -261,7 +261,7 @@ $magicWords = array( * Date formats list for Special:Preferences * see $dateFormats for definitions */ -$datePreferences = array( +$datePreferences = array( 'ČSN basic dt', 'ČSN padded dt', 'ČSN basic td', diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 8167b1948f..6a18ea19a0 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -448,7 +448,7 @@ $specialPageAliases = array( 'PermanentLink' => array( 'PermanentLink', 'PermaLink' ), 'Popularpages' => array( 'PopularPages' ), 'Preferences' => array( 'Preferences' ), - 'Prefixindex' => array( 'PrefixIndex' ) , + 'Prefixindex' => array( 'PrefixIndex' ), 'Protectedpages' => array( 'ProtectedPages' ), 'Protectedtitles' => array( 'ProtectedTitles' ), 'Randompage' => array( 'Random', 'RandomPage' ), diff --git a/languages/messages/MessagesKk_arab.php b/languages/messages/MessagesKk_arab.php index 3fcc4cc754..a33efef64c 100644 --- a/languages/messages/MessagesKk_arab.php +++ b/languages/messages/MessagesKk_arab.php @@ -106,8 +106,8 @@ $namespaceAliases = array( # Aliases to renamed kk-arab namespaces 'مەدياۋيكي' => NS_MEDIAWIKI, - 'مەدياۋيكي_تالقىلاۋى' => NS_MEDIAWIKI_TALK , - 'ٷلگٸ' => NS_TEMPLATE , + 'مەدياۋيكي_تالقىلاۋى' => NS_MEDIAWIKI_TALK, + 'ٷلگٸ' => NS_TEMPLATE, 'ٷلگٸ_تالقىلاۋى' => NS_TEMPLATE_TALK, 'ٴۇلگٴى' => NS_TEMPLATE, 'ٴۇلگٴى_تالقىلاۋى' => NS_TEMPLATE_TALK, diff --git a/languages/messages/MessagesKk_cyrl.php b/languages/messages/MessagesKk_cyrl.php index 3e1b7abea2..680c2eabb8 100644 --- a/languages/messages/MessagesKk_cyrl.php +++ b/languages/messages/MessagesKk_cyrl.php @@ -77,8 +77,8 @@ $namespaceAliases = array( # Aliases to renamed kk-arab namespaces 'مەدياۋيكي' => NS_MEDIAWIKI, - 'مەدياۋيكي_تالقىلاۋى' => NS_MEDIAWIKI_TALK , - 'ٷلگٸ' => NS_TEMPLATE , + 'مەدياۋيكي_تالقىلاۋى' => NS_MEDIAWIKI_TALK, + 'ٷلگٸ' => NS_TEMPLATE, 'ٷلگٸ_تالقىلاۋى' => NS_TEMPLATE_TALK, 'ٴۇلگٴى' => NS_TEMPLATE, 'ٴۇلگٴى_تالقىلاۋى' => NS_TEMPLATE_TALK, diff --git a/languages/messages/MessagesKk_latn.php b/languages/messages/MessagesKk_latn.php index 76aff5b5be..b7f8c6fc31 100644 --- a/languages/messages/MessagesKk_latn.php +++ b/languages/messages/MessagesKk_latn.php @@ -72,8 +72,8 @@ $namespaceAliases = array( # Aliases to renamed kk-arab namespaces 'مەدياۋيكي' => NS_MEDIAWIKI, - 'مەدياۋيكي_تالقىلاۋى' => NS_MEDIAWIKI_TALK , - 'ٷلگٸ' => NS_TEMPLATE , + 'مەدياۋيكي_تالقىلاۋى' => NS_MEDIAWIKI_TALK, + 'ٷلگٸ' => NS_TEMPLATE, 'ٷلگٸ_تالقىلاۋى' => NS_TEMPLATE_TALK, 'ٴۇلگٴى' => NS_TEMPLATE, 'ٴۇلگٴى_تالقىلاۋى' => NS_TEMPLATE_TALK, diff --git a/languages/messages/MessagesOs.php b/languages/messages/MessagesOs.php index 5eaccf669d..3c6561087d 100644 --- a/languages/messages/MessagesOs.php +++ b/languages/messages/MessagesOs.php @@ -180,5 +180,5 @@ $magicWords = array( ); $linkTrail = '/^((?:[a-z]|а|æ|б|в|г|д|е|ё|ж|з|и|й|к|л|м|н|о|п|р|с|т|у|ф|х|ц|ч|ш|щ|ъ|ы|ь|э|ю|я|“|»)+)(.*)$/sDu'; -$fallback8bitEncoding = 'windows-1251'; +$fallback8bitEncoding = 'windows-1251'; diff --git a/languages/messages/MessagesSv.php b/languages/messages/MessagesSv.php index b359c267b6..0d64526f91 100644 --- a/languages/messages/MessagesSv.php +++ b/languages/messages/MessagesSv.php @@ -304,7 +304,7 @@ $magicWords = array( ); $linkTrail = '/^([a-zåäöéÅÄÖÉ]+)(.*)$/sDu'; -$separatorTransformTable = array( +$separatorTransformTable = array( ',' => "\xc2\xa0", // @bug 2749 '.' => ',' ); diff --git a/maintenance/compareParserCache.php b/maintenance/compareParserCache.php index 93fe6601e9..98441b6023 100644 --- a/maintenance/compareParserCache.php +++ b/maintenance/compareParserCache.php @@ -79,7 +79,7 @@ class CompareParserCache extends Maintenance { $this->output( "Found cache entry found for '{$title->getPrefixedText()}'..." ); $oldHtml = trim( preg_replace( '##Us', '', $parserOutputOld->getText() ) ); - $newHtml = trim( preg_replace( '##Us', '',$parserOutputNew->getText() ) ); + $newHtml = trim( preg_replace( '##Us', '', $parserOutputNew->getText() ) ); $diff = wfDiff( $oldHtml, $newHtml ); if ( strlen( $diff ) ) { $this->output( "differences found:\n\n$diff\n\n" ); diff --git a/maintenance/language/generateCollationData.php b/maintenance/language/generateCollationData.php index 2bb5e6bc4b..db6c315e6e 100644 --- a/maintenance/language/generateCollationData.php +++ b/maintenance/language/generateCollationData.php @@ -365,7 +365,7 @@ class UcdXmlReader { $xml = $this->open(); $this->callback = $callback; - while ( $xml->name !== 'repertoire' && $xml->next() ) ; + while ( $xml->name !== 'repertoire' && $xml->next() ); while ( $xml->read() ) { if ( $xml->nodeType == XMLReader::ELEMENT ) { @@ -389,7 +389,7 @@ class UcdXmlReader { if ( !$this->xml ) { throw new MWException( __METHOD__ . ": unable to open {$this->fileName}" ); } - while ( $this->xml->name !== 'ucd' && $this->xml->read() ) ; + while ( $this->xml->name !== 'ucd' && $this->xml->read() ); $this->xml->read(); return $this->xml; @@ -450,7 +450,7 @@ class UcdXmlReader { } $xml = $this->open(); - while ( $xml->name !== 'blocks' && $xml->read() ) ; + while ( $xml->name !== 'blocks' && $xml->read() ); while ( $xml->read() ) { if ( $xml->nodeType == XMLReader::ELEMENT ) { diff --git a/mw-config/index.php b/mw-config/index.php index be176c7204..a6cebc3951 100644 --- a/mw-config/index.php +++ b/mw-config/index.php @@ -44,7 +44,7 @@ function wfInstallerMain() { if ( !$installer->startSession() ) { - if( $installer->request->getVal( "css" ) ) { + if ( $installer->request->getVal( "css" ) ) { // Do not display errors on css pages $installer->outputCss(); exit; diff --git a/skins/Vector/VectorTemplate.php b/skins/Vector/VectorTemplate.php index 7dc376ae77..bffc65d86c 100644 --- a/skins/Vector/VectorTemplate.php +++ b/skins/Vector/VectorTemplate.php @@ -551,7 +551,7 @@ class VectorTemplate extends BaseTemplate {
assertRegExp( $output, $timestamp, $message ); + $this->assertRegExp( $output, $timestamp, $message ); } else { $this->assertEquals( $output, $timestamp, $message ); } diff --git a/tests/phpunit/includes/ImportTest.php b/tests/phpunit/includes/ImportTest.php index 889540381a..70014bf203 100644 --- a/tests/phpunit/includes/ImportTest.php +++ b/tests/phpunit/includes/ImportTest.php @@ -26,7 +26,7 @@ class ImportTest extends MediaWikiLangTestCase { public function testHandlePageContainsRedirect( $xml, $redirectTitle ) { $source = $this->getInputStreamSource( $xml ); - $redirect = NULL; + $redirect = null; $callback = function( $title, $origTitle, $revCount, $sRevCount, $pageInfo ) use ( &$redirect ) { if ( array_key_exists( 'redirect', $pageInfo ) ) { $redirect = $pageInfo['redirect']; @@ -92,7 +92,7 @@ EOF EOF , - NULL + null ), ); } diff --git a/tests/phpunit/includes/LinksUpdateTest.php b/tests/phpunit/includes/LinksUpdateTest.php index a5dac8d809..02f6b2ab2d 100644 --- a/tests/phpunit/includes/LinksUpdateTest.php +++ b/tests/phpunit/includes/LinksUpdateTest.php @@ -215,8 +215,8 @@ class LinksUpdateTest extends MediaWikiTestCase { $po->setProperty( "bool", true ); $expected[] = array( "bool", true ); - $po->setProperty( "float", 4.0 + 1.0/4.0 ); - $expected[] = array( "float", 4.0 + 1.0/4.0 ); + $po->setProperty( "float", 4.0 + 1.0 / 4.0 ); + $expected[] = array( "float", 4.0 + 1.0 / 4.0 ); $po->setProperty( "int", -7 ); $expected[] = array( "int", -7 ); diff --git a/tests/phpunit/includes/OutputPageTest.php b/tests/phpunit/includes/OutputPageTest.php index 5fee505361..77a531308b 100644 --- a/tests/phpunit/includes/OutputPageTest.php +++ b/tests/phpunit/includes/OutputPageTest.php @@ -179,7 +179,7 @@ mw.loader.implement("test.quux",function($,jQuery){mw.test.baz({token:123});},{" * @dataProvider provideMakeResourceLoaderLink * @covers OutputPage::makeResourceLoaderLink */ - public function testMakeResourceLoaderLink( $args, $expectedHtml) { + public function testMakeResourceLoaderLink( $args, $expectedHtml ) { $this->setMwGlobals( array( 'wgResourceLoaderDebug' => false, 'wgResourceLoaderUseESI' => true, @@ -199,19 +199,19 @@ mw.loader.implement("test.quux",function($,jQuery){mw.test.baz({token:123});},{" $out = new OutputPage( $ctx ); $rl = $out->getResourceLoader(); $rl->register( array( - 'test.foo' => new ResourceLoaderTestModule(array( + 'test.foo' => new ResourceLoaderTestModule( array( 'script' => 'mw.test.foo( { a: true } );', 'styles' => '.mw-test-foo { content: "style"; }', )), - 'test.bar' => new ResourceLoaderTestModule(array( + 'test.bar' => new ResourceLoaderTestModule( array( 'script' => 'mw.test.bar( { a: true } );', 'styles' => '.mw-test-bar { content: "style"; }', )), - 'test.baz' => new ResourceLoaderTestModule(array( + 'test.baz' => new ResourceLoaderTestModule( array( 'script' => 'mw.test.baz( { a: true } );', 'styles' => '.mw-test-baz { content: "style"; }', )), - 'test.quux' => new ResourceLoaderTestModule(array( + 'test.quux' => new ResourceLoaderTestModule( array( 'script' => 'mw.test.baz( { token: 123 } );', 'styles' => '/* pref-animate=off */ .mw-icon { transition: none; }', 'group' => 'private', diff --git a/tests/phpunit/includes/TimeAdjustTest.php b/tests/phpunit/includes/TimeAdjustTest.php index f0d4c4dcb8..ae82bc4079 100644 --- a/tests/phpunit/includes/TimeAdjustTest.php +++ b/tests/phpunit/includes/TimeAdjustTest.php @@ -26,7 +26,7 @@ class TimeAdjustTest extends MediaWikiLangTestCase { return array( array( '20061231235959', 0, '20061231235959' ), array( '20061231235959', 5, '20070101000459' ), - array( '20061231235959', 15,'20070101001459' ), + array( '20061231235959', 15, '20070101001459' ), array( '20061231235959', 60, '20070101005959' ), array( '20061231235959', 90, '20070101012959' ), array( '20061231235959', 120, '20070101015959' ), diff --git a/tests/phpunit/includes/actions/ActionTest.php b/tests/phpunit/includes/actions/ActionTest.php index 839a0c5c5e..4a927edce8 100644 --- a/tests/phpunit/includes/actions/ActionTest.php +++ b/tests/phpunit/includes/actions/ActionTest.php @@ -14,12 +14,12 @@ class ActionTest extends MediaWikiTestCase { parent::setUp(); $this->setMwGlobals( 'wgActions', array( - 'null' => null, - 'dummy' => true, - 'string' => 'NamedDummyAction', + 'null' => null, + 'dummy' => true, + 'string' => 'NamedDummyAction', 'declared' => 'NonExistingClassName', 'callable' => array( $this, 'dummyActionCallback' ), - 'object' => new InstantiatedDummyAction( $this->getPage(), $this->getContext() ), + 'object' => new InstantiatedDummyAction( $this->getPage(), $this->getContext() ), ) ); } @@ -33,19 +33,19 @@ class ActionTest extends MediaWikiTestCase { public function actionProvider() { return array( - array( 'dummy', 'DummyAction' ), - array( 'string', 'NamedDummyAction' ), + array( 'dummy', 'DummyAction' ), + array( 'string', 'NamedDummyAction' ), array( 'callable', 'CalledDummyAction' ), - array( 'object', 'InstantiatedDummyAction' ), + array( 'object', 'InstantiatedDummyAction' ), // Capitalization is ignored - array( 'STRING', 'NamedDummyAction' ), + array( 'STRING', 'NamedDummyAction' ), // Null and non-existing values - array( 'null', null ), + array( 'null', null ), array( 'undeclared', null ), - array( '', null ), - array( null, null ), + array( '', null ), + array( null, null ), ); } diff --git a/tests/phpunit/includes/config/ConfigFactoryTest.php b/tests/phpunit/includes/config/ConfigFactoryTest.php index 0a6bf723f8..11bce51b5e 100644 --- a/tests/phpunit/includes/config/ConfigFactoryTest.php +++ b/tests/phpunit/includes/config/ConfigFactoryTest.php @@ -8,7 +8,7 @@ class ConfigFactoryTest extends MediaWikiTestCase { public function testRegister() { $factory = new ConfigFactory(); $factory->register( 'unittest', 'GlobalVarConfig::newInstance' ); - $this->assertTrue( True ); // No exception thrown + $this->assertTrue( true ); // No exception thrown $this->setExpectedException( 'InvalidArgumentException' ); $factory->register( 'invalid', 'Invalid callback' ); } @@ -39,7 +39,7 @@ class ConfigFactoryTest extends MediaWikiTestCase { $factory = new ConfigFactory(); $factory->register( 'unittest', function() { return true; // Not a Config object - }); + } ); $this->setExpectedException( 'UnexpectedValueException' ); $factory->makeConfig( 'unittest' ); } diff --git a/tests/phpunit/includes/db/DatabaseSqliteTest.php b/tests/phpunit/includes/db/DatabaseSqliteTest.php index 88bf7d99d0..1db6faec53 100644 --- a/tests/phpunit/includes/db/DatabaseSqliteTest.php +++ b/tests/phpunit/includes/db/DatabaseSqliteTest.php @@ -440,12 +440,12 @@ class DatabaseSqliteTest extends MediaWikiTestCase { $databaseCreation = $db->query( 'CREATE TABLE a ( a_1 )', __METHOD__ ); $this->assertInstanceOf( 'ResultWrapper', $databaseCreation, "Failed to create table a" ); - $res = $db->select( 'a' , '*'); - $this->assertEquals( 0, $db->numFields($res), "expects to get 0 fields for an empty table" ); + $res = $db->select( 'a', '*' ); + $this->assertEquals( 0, $db->numFields( $res ), "expects to get 0 fields for an empty table" ); $insertion = $db->insert( 'a', array( 'a_1' => 10 ), __METHOD__ ); $this->assertTrue( $insertion, "Insertion failed" ); - $res = $db->select( 'a' , '*'); - $this->assertEquals( 1, $db->numFields($res), "wrong number of fields" ); + $res = $db->select( 'a', '*' ); + $this->assertEquals( 1, $db->numFields( $res ), "wrong number of fields" ); $this->assertTrue( $db->close(), "closing database" ); } diff --git a/tests/phpunit/includes/debug/MWDebugTest.php b/tests/phpunit/includes/debug/MWDebugTest.php index e642177f33..17c6224cd9 100644 --- a/tests/phpunit/includes/debug/MWDebugTest.php +++ b/tests/phpunit/includes/debug/MWDebugTest.php @@ -107,7 +107,7 @@ class MWDebugTest extends MediaWikiTestCase { 'gitViewUrl', 'time', 'log', 'debugLog', 'queries', 'request', 'memory', 'memoryPeak', 'includes', 'profile', '_element' ); - foreach( $expectedKeys as $expectedKey ) { + foreach ( $expectedKeys as $expectedKey ) { $this->assertArrayHasKey( $expectedKey, $data['debuginfo'], "debuginfo has $expectedKey" ); } diff --git a/tests/phpunit/includes/media/MediaWikiMediaTestCase.php b/tests/phpunit/includes/media/MediaWikiMediaTestCase.php index 7b64dfde24..1b8ecf27d6 100644 --- a/tests/phpunit/includes/media/MediaWikiMediaTestCase.php +++ b/tests/phpunit/includes/media/MediaWikiMediaTestCase.php @@ -78,7 +78,7 @@ abstract class MediaWikiMediaTestCase extends MediaWikiTestCase { // Autodetect by file extension for the lazy. $magic = MimeMagic::singleton(); $parts = explode( $name, '.' ); - $type = $magic->guessTypesForExtension( $parts[count( $parts ) - 1] ); + $type = $magic->guessTypesForExtension( $parts[count( $parts ) - 1] ); } return new UnregisteredLocalFile( false, $this->repo, "mwstore://localtesting/data/$name", $type ); diff --git a/tests/phpunit/includes/parser/ParserMethodsTest.php b/tests/phpunit/includes/parser/ParserMethodsTest.php index 29af2c28d6..cbf480353a 100644 --- a/tests/phpunit/includes/parser/ParserMethodsTest.php +++ b/tests/phpunit/includes/parser/ParserMethodsTest.php @@ -78,7 +78,7 @@ class ParserMethodsTest extends MediaWikiLangTestCase { $wgParser->parse( 'baz', $title, $po ); } - public function helperParserFunc( $input, $args, $parser) { + public function helperParserFunc( $input, $args, $parser ) { $title = Title::newFromText( 'foo' ); $po = new ParserOptions; $parser->parse( $input, $title, $po ); diff --git a/tests/phpunit/includes/poolcounter/PoolCounterTest.php b/tests/phpunit/includes/poolcounter/PoolCounterTest.php index 2d31d088ee..d9cd57eed1 100644 --- a/tests/phpunit/includes/poolcounter/PoolCounterTest.php +++ b/tests/phpunit/includes/poolcounter/PoolCounterTest.php @@ -50,10 +50,9 @@ class PoolCounterTest extends MediaWikiTestCase { ->disableOriginalConstructor() ->getMockForAbstractClass(); - $hashKeyIntoSlots = new ReflectionMethod($poolCounter, 'hashKeyIntoSlots' ); + $hashKeyIntoSlots = new ReflectionMethod( $poolCounter, 'hashKeyIntoSlots' ); $hashKeyIntoSlots->setAccessible( true ); - $keysWithTwoSlots = $keysWithFiveSlots = array(); foreach ( range( 1, 100 ) as $i ) { $keysWithTwoSlots[] = $hashKeyIntoSlots->invoke( $poolCounter, 'key ' . $i, 2 ); diff --git a/tests/phpunit/phpunit.php b/tests/phpunit/phpunit.php index d2a41324fa..bed9c9eab8 100755 --- a/tests/phpunit/phpunit.php +++ b/tests/phpunit/phpunit.php @@ -105,7 +105,7 @@ class PHPUnitMaintClass extends Maintenance { # The below code injects a parameter just like if the user called # Probably fix bug 29226 $key = array_search( '--colors', $_SERVER['argv'] ); - if( $key === false ) { + if ( $key === false ) { array_splice( $_SERVER['argv'], 1, 0, '--colors' ); } } @@ -115,7 +115,7 @@ class PHPUnitMaintClass extends Maintenance { # PHPUnit uses stream_resolve_include_path() internally # See bug 32022 $key = array_search( '--include-path', $_SERVER['argv'] ); - if( $key === false ) { + if ( $key === false ) { array_splice( $_SERVER['argv'], 1, 0, __DIR__ . PATH_SEPARATOR